#include <opencv2/opencv.hpp>
#include <iostream>

using namespace cv; //Must Need Write cv
using namespace std;

/*
 * ./opencv_imread_demo3 <image_path1> <image_path2>
 *
 */

int main(int argc, char** argv)
{
    if (argc < 3) {
        std::cerr << "Usage: " << argv[0] << " <image_path1> <image_path2> " << std::endl;
        return -1;
    }

    Mat img1 = imread(argv[1], IMREAD_UNCHANGED);
    printf("width = %d, height = %d, channels = %d\n", img1.cols, img1.rows, img1.channels());

    Mat img2 = imread(argv[1], IMREAD_GRAYSCALE);
    printf("width = %d, height = %d, channels = %d\n", img2.cols, img2.rows, img2.channels());

    Mat img3 = imread(argv[1], IMREAD_COLOR);
    printf("width = %d, height = %d, channels = %d\n", img3.cols, img3.rows, img3.channels());
	

    Mat img4 = imread(argv[2], IMREAD_COLOR);

    std::vector<int> params = {cv::IMWRITE_JPEG_QUALITY, 40};
    
    imwrite("/userdata/quality_test_demo_40.jpg", img4, params);

    params = {cv::IMWRITE_JPEG_QUALITY, 100};
    imwrite("/userdata/quality_test_demo_100.jpg", img4, params);
	
	
    return 0;
}


